CONTENTS | INDEX | PREV | NEXT
FUNCTION
Create #pragma statements from .FD files
SYNOPSIS
fdtopragma source/ [-o dest]
fdtopragma
This program generates header files containing #pragma libcall lines
for use with inline library calls. #pragma is an ANSI C mechanism to
allow compiler extensions. #pragma libcall is an Amiga standard for
describing shared library entries, allowing the compiler to generate
calls directly, rather than requiring linking in cumbersome interface
functions. .FD files are a standard format file that describe the
function names and offsets of shared runtime libraries. See section
for a description of the format.
The source may be specified as a single file, or as a directory (with
trailing /). Under DICE, these header files are stored in
DINCLUDE:CLIB/ and mimic the Commodore standard headers in
DINCLUDE:AMIGA20/CLIB/. The purpose of the mimicry is to have a
single standard for specification of prototypes, the Commodore
standard:
#include <clib/exec_protos.h>
If no pragma header exists, the Commodore standard header will be
included. If a pragma header does exist, it will be included. Rhe
pragma header file explicitly #include's the original Commodore
header file and then conditionally generate the #pragma lines based
on whether you specified the -mi option to DCC. The -mi option to
DCC simply defines the preprocessor symbol __DICE_INLINE which causes
the #pragma lines to be conditionally included. It is important to
note that great pains have been taken to allow you to turn on and off
inline library calls for your program without having to modify the
source in any way, shape, or form.
.fd files are formatted very simply. For the Commodore libraries,
these files are stored in dinclude:amigaxx/fd/". Comments start with
"*", commands start with "##", and everything else is assumed to be a
function entry. The commands are:
Command : Usage : :
========+=======+============+======================================
: : base : Base pointer name for this library
: : _DOSBase : (DOSBase)
--------+-------+------------+--------------------------------------
: : bias 30 : New negative function offset
: : : (Negative 30)
--------+-------+------------+--------------------------------------
: : public : Until next
--------+-------+------------+--------------------------------------
: : private : Until next
--------+-------+------------+--------------------------------------
: : end : End marker
--------+-------+------------+--------------------------------------
The following function entry defines four parameters, which must be
passed in registers A0,D0,A1 and D1 respectively. A "/" separator is
a hint to some programs that registers are in proper order to move
from the stack with a single 68000 "MOVEM" instruction:
OpenDevice(devName,unit,ioRequest,flags)(a0,d0/a1,d1)
Library functions exist as negative offsets from the library base;
##bias sets a new negative offset. Each function entry decrements
the offset by six.